<template>
    <div>
        <navBar :navTitle="$t('Cangkuxiangqing')" />
        <div class="flex-between tradeInfo-title">
            <b>
                <span>{{ tradeInfoObj.sectorName }}（{{ tradeInfoObj.symbol }}）</span>
                <span class="bg-red color-white">{{ tradeInfoObj.mairu_type_name }}</span>
            </b>
            <b class="color-theme">{{ tradeInfoObj.status_name }}</b>
        </div>
        <van-cell-group>
            <van-cell :title="$t('Xuliehao')">
                <template #extra>
                    <span class="color-theme">{{ tradeInfoObj.number }}</span>
                </template>
            </van-cell>
            <van-cell :title="$t('Shijian') + 'GD'" :value="tradeInfoObj.mairu_time" />
            <van-cell :title="$t('Goumaijia')" :value="tradeInfoObj.mairu_money" />
            <van-cell :title="$t('Xiaoshoujiage')" :value="tradeInfoObj.limit_maichu_price" />
            <van-cell :title="$t('Goumaishuliang')">
                <template #default>
                    <span class="custom-title">{{ tradeInfoObj.mairu_ori / 1000 }}Lô</span>
                </template>
            </van-cell>
            <van-cell :title="$t('Baochidianliu')" :value="tradeInfoObj.mairu_num">
                <template #default>
                    <span class="custom-title">{{ tradeInfoObj.mairu_num / 1000 }}Lô</span>
                </template>
            </van-cell>

            <!--<van-cell title="原始保證金" :value="tradeInfoObj.bond" />-->
            <van-cell :title="$t('Ganggalv')" :value="tradeInfoObj.ganggang_beilv" />
            <van-cell :title="$t('Shichangjia')" :value="tradeInfoObj.shizhi" />
            <van-cell :title="$t('Leixing')" :value="tradeInfoObj.mairu_type_name" />
        </van-cell-group>
    </div>
</template>

<script>
import { index_qchicang_mingxi_api } from "@/assets/js/api";

export default {
    name: "trade_info",
    data() {
        return {
            tradeInfoObj: {
                mairu_num: 0,
                mairu_ori: 0,
            },
            id: "",
        }
    },
    methods: {
        getInfo() {
            index_qchicang_mingxi_api({
                id: this.id,
                quser_id: localStorage.getItem("userId"),
            }).then(res => {
                if (res.code == 200) {
                    this.tradeInfoObj = res.data;
                }
            });
        }
    },
    created() {
        this.id = this.$route.query.id;
        this.getInfo();
    },
}
</script>
<style lang="scss" scoped>
.tradeInfo-title {
    height: 50px;
    display: flex;
    align-items: center;
    background-color: #f1f4ff;
    padding: 0 20px;
    font-size: 15px;
}
</style>